'use strict';
import * as types from '../Commom/ActionConst';

export function doRefreshWithBack(dataWith){
	return dispatch => {
		if(dataWith){
			dispatch(refreshWithBack(dataWith));
		}
		else{
			dispatch(refreshWithClear());
		}
	}
}

function refreshWithBack(dataWith){
	return {
	    type:types.REFRESH_WITH_BACK,
	    dataFromBack:dataWith
	  }
}

function refreshWithClear(){
	return {
	    type:types.REFRESH_WITH_CLEAR,
	    dataFromBack:null
	  }
}